<template>
	<jst-view>
		<!--#ifdef THEME-TWO-->
		<index-two ref="indexPage"></index-two>
		<!--#endif-->
		<!--#ifdef H5 || APP-->
		<component ref="indexPage" v-bind:is="pairStatus"></component>
		<!--#endif-->
	</jst-view>
</template>

<script>
import { mapGetters,mapActions } from "vuex";
//#ifdef H5 || APP || THEME-ONE
import indexOne from './components/theme-one/index.vue'
//#endif
//#ifdef H5 || APP || THEME-TWO
import indexTwo from './components/theme-two/index.vue'
//#endif
export default {
	components: {
		//#ifdef H5 || APP || THEME-ONE
		indexOne,
		//#endif
		//#ifdef H5 || APP  || THEME-TWO
		indexTwo
		//#endif
	},
	data() {
		return {
			pairStatus: 'indexTwo'
		}
	},
	onShow(){
		if (this.pairStatu) {
			console.log('已配对');
		}else{
			console.log('未配对');
			/* uni.navigateTo({
			    url: '/pages/home/homePair'
			}); */
		}
	},
	computed:{
		...mapGetters(["modelType", "pairStatu"])
	},
	methods:{
		...mapActions("user", ["setModelType", "setPairStatu"]),
	},
	onPullDownRefresh() {
		if(this.$refs.indexPage) {
			this.$refs.indexPage.getData()
		}
	}
}
</script>

<style lang="scss">
.header{
	height: 120rpx;
}
.body{
	height: calc(100% - 170rpx);
}
</style>
